package com.eonmind.ai.service.impl;

import com.eonmind.ai.converts.AiChatConvert;
import com.eonmind.ai.dto.AiChatDto;
import com.eonmind.ai.mapper.AiAssistantMapper;
import com.eonmind.ai.service.IAiAssistantService;
import com.eonmind.common.provider.entity.ai.AiAssistant;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class AiAssistantService implements IAiAssistantService {
    @Resource
    private AiAssistantMapper aiAssistantMapper;

    @Override
    public List<AiChatDto.AiAssistantData> listAssistant(String keyword) {
        List<AiAssistant> assistantList = aiAssistantMapper.selectByName(keyword);
        return AiChatConvert.toAiAssistantDataList(assistantList);
    }
}
